<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>建设单位--新建项目</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="/static/css/buildUnit/common.css">
    <style>
        body {
            height: auto;
        }

        .content {
            padding: 20px;
        }
        .layui-container {
            padding-top: 20px;
            width: auto;;
        }

        /*单元格备注样式*/
        .layui-table td.tdBz {
            text-align: left;
            padding-left: 0;
            border-left: none;
            color: #aaa;
        }

        .padNone .layui-form-select .layui-input {
            padding-right: 0;
        }

        .hide {
            display: none;
        }
    </style>
</head>
<body>
<div class="layui-container">
    <form id="form" class="layui-form layui-form-pane" action="" lay-filter="example">
        <input type="hidden" name="buildCorpId" class="formData" value="">
        <input type="hidden" name="prjId" class="formData" value="">


        <!--项目概况-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">项目概况</h2>
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8 required">工程项目名称</td>
                            <td colspan="5" id="devUnitName">
                                <input name="prjName" type="text" lay-verify="isEmpty|uname" class="layui-input formData"
                                       placeholder="请输入工程项目名称" autocomplete="off"
                                >
                            </td>
                        </tr>
                        <tr>
                            <td class="th8 required">工程项目地址</td>
                            <td colspan="5">
                                <div class="layui-input-inline">
                                    <select name="provinceNum" lay-filter="provinceNum" lay-verify="isEmpty" disabled
                                            class="formData layui-disabled">
                                        <option value="">请选择省</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    <select name="cityNum" lay-filter="cityNum" lay-verify="isEmpty" class="formData">
                                        <option value="">请选择市</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    <select name="countyNum" lay-filter="countyNum" lay-verify="isEmpty"
                                            class="formData">
                                        <option value="">请选择县/区</option>
                                    </select>
                                </div>
                                <div class="layui-input-inline">
                                    <input name="address" lay-verify="isEmpty" type="text" class="layui-input formData">
                                </div>
                            </td>
                        </tr>

                        <tr>
                            <td class="th8">工程项目类别</td>
                            <td colspan="2">
                                <select name="prjCategory" lay-verify="isEmpty" id="prjCategory" class="formData">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td class="th8">工程性质</td>
                            <td colspan="2">
                                <select name="prjQuality" lay-verify="isEmpty" id="prjQuality" class="formData">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">工程用途</td>
                            <td colspan="2">
                                <select name="prjPurpose" lay-verify="isEmpty" id="prjPurpose" class="formData">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                            <td class="th8">项目建设规模</td>
                            <td colspan="2">
                                <select name="prjScale" lay-verify="isEmpty" id="prjScale" class="formData">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">立项文号</td>
                            <td colspan="2">
                                <input name="prjApprovalNum" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="请输入立项文号" autocomplete="off"
                                >
                            </td>
                            <td class="th8">立项来源</td>
                            <td colspan="2">
                                <select name="prjApprovalSource" lay-verify="isEmpty" class="formData"
                                        id="prjApprovalSource">
                                    <option value="">请选择</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">项目批复机关</td>
                            <td colspan="2">
                                <input name="prjApprovalDeptName" lay-verify="isEmpty" type="text"
                                       class="layui-input formData"
                                       placeholder="请输入项目批复机关"
                                >
                            </td>
                            <td class="th8">项目批复时间</td>
                            <td colspan="2">
                                <input name="prjApprovalTime" lay-verify="isEmpty" type="text"
                                       class="layui-input formData timeSelectBox"
                                       placeholder="请输入项目批复时间"
                                       readonly>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">计划开工时间</td>
                            <td colspan="2">
                                <input name="planStartTime" lay-verify="isEmpty" type="text"
                                       class="layui-input formData timeSelectBox"  placeholder="请输入计划开工时间" readonly
                                >
                            </td>
                            <td class="th8">计划竣工时间</td>
                            <td colspan="2">
                                <input name="planCompleteTime" lay-verify="isEmpty" type="text"
                                       class="layui-input formData timeSelectBox"
                                       placeholder="请输入计划竣工时间" readonly
                                >
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">总面积(㎡)</td>
                            <td colspan="2">
                                <input name="totalArea" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="请输入总面积(㎡)" autocomplete="off">
                            </td>
                            <td class="th8">总造价(万)</td>
                            <td colspan="2">
                                <input name="totalInvestment" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="请输入总造价(万)" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">结构类型</td>
                            <td colspan="2">
                                <input name="jglx" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="结构类型" autocomplete="off">
                            </td>
                            <td class="th8">层数</td>
                            <td colspan="2">
                                <input name="cs" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="层数" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">工程施工许可证号</td>
                            <td colspan="2">
                                <input name="gcsgxkzh" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="工程施工许可证号" autocomplete="off">
                            </td>
                            <td class="th8">施工图审查批号</td>
                            <td colspan="2">
                                <input name="sgtscph" lay-verify="isEmpty" type="text"
                                       class="layui-input formData" placeholder="施工图审查批号" autocomplete="off">
                            </td>
                        </tr>
                        <tr>
                            <td class="th8">工程描述</td>
                            <td colspan="5">
                                <textarea name="gcms" lay-verify="isEmpty" type="text" rows="3"
                                       class="layui-input formData" placeholder="工程描述" autocomplete="off">
                                </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td class="th8"></td>
                            <td colspan="6">
                                是否为重点项目：

                                <input class="formData" type="radio" name="isImportant" value="1" title="是">
                                <input class="formData" type="radio" name="isImportant" value="0" title="否">

                                是否装配式建筑：
                                <input class="formData" type="radio" name="isZps" value="1" title="是">
                                <input class="formData" type="radio" name="isZps" value="0" title="否">

                                是否被动房建筑：
                                <input class="formData" type="radio" name="isBdf" value="1" title="是">
                                <input class="formData" type="radio" name="isBdf" value="0" title="否">

                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <!--参见单位信息-->
        <div class="layui-collapse">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">参建单位信息</h2>

                <!-- 建设单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">建设单位名称</td>
                            <td colspan="2">
                                <input name="buildCorpName" lay-verify="isEmpty" type="text"
                                       class="layui-input layui-disabled formData" disabled 
                                       placeholder="建设单位名称">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input name="buildComartiperson" type="text"
                                       class="layui-input layui-disabled formData" disabled
                                       placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader1" style="display:none">
                            <td class="th8">建设单位项目负责人</td>
                            <td colspan="2">
                                <input name="buildProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="项目负责人">
                            </td>
                            <td class="th8">联系电话</td>
                            <td colspan="2">
                                <input name="buildCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off" value=""
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!-- 施工单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">施工单位名称</td>
                            <td colspan="2">
                                <input type="text" id="sgCorpName" name="sgCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="施工单位名称">
                                <input type="hidden" id="sgCorpId" name="sgCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="sgComartiperson" name="sgComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader2" style="display:none">
                            <td class="th8">施工单位项目负责人</td>
                            <td colspan="2">
                                <input name="sgProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="项目负责人">
                            </td>
                            <td class="th8">联系电话</td>
                            <td colspan="2">
                                <input name="sgCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!-- 监理单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">监理单位名称</td>
                            <td colspan="2">
                                <input type="text" id="jlCorpName" name="jlCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="单位名称">
                                <input type="hidden" id="jlCorpId" name="jlCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="jlComartiperson" name="jlComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader3" style="display:none">
                            <td class="th8">项目负责人</td>
                            <td colspan="2">
                            <input name="jlProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                            class="layui-input formData" autocomplete="off"
                            placeholder="项目负责人">
                            </td>
                            <td class="th8">联系电话</td>
                            <td colspan="2">
                                <input name="jlCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!-- 勘察单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">勘察单位名称</td>
                            <td colspan="2">
                                <input type="text" id="kcCorpName" name="kcCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="勘察单位名称">
                                <input type="hidden" id="kcCorpId" name="kcCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="kcComartiperson" name="kcComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader4" style="display:none">
                            <td class="th8">项目负责人</td>
                            <td colspan="2">
                                <input name="kcProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                class="layui-input formData" autocomplete="off"
                                placeholder="项目负责人">
                            </td>
                            <td class="th8">联系电话</td>
                            <td colspan="2">
                                <input name="kcCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <!-- 设计单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">设计单位名称</td>
                            <td colspan="2">
                                <input type="text" id="sjCorpName" name="sjCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="设计单位名称">
                                <input type="hidden" id="sjCorpId" name="sjCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="sjComartiperson" name="sjComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader5" style="display:none">
                            <td class="th8">项目负责人</td>
                            <td colspan="2">
                                <input name="sjProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="项目负责人">
                            <!--</td>-->
                            <td class="th8">联系电话</td>
                            <td colspan="2">
                                <input name="sjCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <!-- 审图单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">审图单位名称</td>
                            <td colspan="2">
                                <input type="text" id="stCorpName" name="stCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="单位名称">
                                <input type="hidden" id="stCorpId" name="stCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="stComartiperson" name="stComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader6" style="display:none">
                            <td class="th8 required">项目负责人</td>
                            <td colspan="2">
                                <input name="stProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="项目负责人">
                            </td>
                            <td class="th8 required">联系电话</td>
                            <td colspan="2">
                                <input name="stCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" value="" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <!-- 检测单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">检测单位名称</td>
                            <td colspan="2">
                                <input type="text" id="jcCorpName" name="jcCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="单位名称">
                                <input type="hidden" id="jcCorpId" name="jcCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="jcComartiperson" name="jcComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr id="projectLeader7" style="display:none">
                            <td class="th8 required">项目负责人</td>
                            <td colspan="2">
                                <input name="jcProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                class="layui-input formData" autocomplete="off"
                                placeholder="项目负责人">
                            </td>
                            <td class="th8 required">联系电话</td>
                            <td colspan="2">
                                <input name="jcCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>


                <!-- 预拌混凝土单位 -->
                <div class="layui-colla-content layui-show">
                    <table class="layui-table v-table">
                        <tbody>
                        <tr class="hide">
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                            <td width="24%"></td>
                            <td width="13%"></td>
                            <td width="13%"></td>
                        </tr>
                        <tr>
                            <td class="th8">预拌混凝土单位名称</td>
                            <td colspan="2">
                                <input type="text" id="ybhntCorpName" name="ybhntCorpName" lay-verify="isEmpty" class="layui-input formData" readonly placeholder="单位名称">
                                <input type="hidden" id="ybhntCorpId" name="ybhntCorpId" class="formData" autocomplete="off" lay-verify="required">
                            </td>
                            <td class="th8">法定代表人</td>
                            <td colspan="2">
                                <input id="ybhntComartiperson" name="ybhntComartiperson" type="text" class="layui-input layui-disabled formData" readonly placeholder="法定代表人">
                            </td>
                        </tr>
                        <tr  id="projectLeader8" style="display:none">
                            <td class="th8 required">项目负责人</td>
                            <td colspan="2">
                                <input name="ybhntProjectLeaderName" lay-verify="isEmpty" type="text" disabled
                                class="layui-input formData" autocomplete="off"
                                placeholder="项目负责人">
                            </td>
                            <td class="th8 required">联系电话</td>
                            <td colspan="2">
                                <input name="ybhntCorpLinkPhone" lay-verify="isEmpty|linkPhone" type="text" disabled
                                       class="layui-input formData" autocomplete="off"
                                       placeholder="联系电话">
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
		

		


        <button lay-submit lay-filter="submit" style="display: none;" id="submit" class="demo1">提交</button>
    </form>
</div>
<script src="/static/js/main.js"></script>
<script type="text/javascript">
    var $;
    layui.use(['jquery', 'element', 'form', 'laydate', 'configure', 'configureCom', 'selectFun', 'bluebird', 'replaceStr', 'jsDictFile', 'mapExtend'], function () {
        $ = layui.jquery;
		var element = layui.element;
        var form = layui.form;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var laydate = layui.laydate;
        var selectFun = layui.selectFun;
        var sessionFun = layui.sessionFun;//存储session
        var token = sessionFun.get(configure.SESSION_TOKEN) ? sessionFun.get(configure.SESSION_TOKEN).token : '';
        $('.timeSelectBox').each(function (index, item) {
            laydate.render({
                elem: item
            })
        });
        var defaults = {};
        var listData = sessionFun.get(configure.SESSION_PROJECT_LIST_DATA);//获取 存储的session
        var readOnly = sessionFun.get(configure.SESSION_PROJECT_LIST_READONLY);


        if(readOnly){
            $("#projectLeader1").show();
            $("#projectLeader2").show();
            $("#projectLeader3").show();
            $("#projectLeader4").show();
            $("#projectLeader5").show();
            $("#projectLeader6").show();
            $("#projectLeader7").show();
            $("#projectLeader8").show();
        }

        if (!listData) {
            defaults = {
                s1: 'provinceNum',
                s2: 'cityNum',
                s3: 'countyNum',
                v1: 130000,
                v2: null,
                v3: null
            };
            //创建
            //给下拉框填充内容
            configureCom.selectDataFun(configure.PRJ_CATEGORY, '', '#prjCategory');//工程项目类别
            configureCom.selectDataFun(configure.PRJ_PROPERTY, '', '#prjQuality');//工程性质
            configureCom.selectDataFun(configure.PRJ_FUNCTION, '', '#prjPurpose');//工程用途
            configureCom.selectDataFun(configure.PRJ_SCALE, '', '#prjScale');//项目建设规模
            configureCom.selectDataFun(configure.PRJ_APPROVAL_SOURCE, '', '#prjApprovalSource');//立项来源
            //查询建设单位信息
            configureCom.postDataAjax(configure.BUILDUNIT_INFO_SAVE).then(function (res) {
                console.log(res);
                var prjData = {
                    buildCorpId: res.prjProject.buildCorpId,
                    buildCorpName: res.prjProject.buildCorpName,
                    buildComartiperson: res.prjProject.buildComartiperson
                };
                form.val('example', prjData);
            });

        } else {
            defaults = {
                s1: 'provinceNum',
                s2: 'cityNum',
                s3: 'countyNum',
                v1: 130000,
                v2: listData.cityNum,
                v3: listData.countyNum
            };
            //修改
            //给下拉框填充内容
            configureCom.selectDataFun(configure.PRJ_CATEGORY, listData.prjCategory, '#prjCategory');//工程项目类别
            configureCom.selectDataFun(configure.PRJ_PROPERTY, listData.prjQuality, '#prjQuality');//工程性质
            configureCom.selectDataFun(configure.PRJ_FUNCTION, listData.prjPurpose, '#prjPurpose');//工程用途
            configureCom.selectDataFun(configure.PRJ_SCALE, listData.prjScale, '#prjScale');//项目建设规模
            configureCom.selectDataFun(configure.PRJ_APPROVAL_SOURCE, listData.prjApprovalSource, '#prjApprovalSource');//立项来源

            var index = top.layer.load(1, {shade: 0.01});
            $.ajax({
                url: configure.PRJ_PROJECT_INFO_API+"?token="+token,
                type: 'get',
                cache: false,
                async:false,
                data: {prjId:listData.prjId},
                success: function (data) {
                    top.layer.close(index);
                    var res = data;
                    if(res.code==0){
                        form.val('example', res.data);
                    }
                },
                error: function (data) {
                    top.layer.close(index);
                }
            });

        }
        element.render('collapse');
        selectFun.treeSelect(defaults);
        form.render();

		//监听submit提交
        form.on('submit(submit)', function (data) {
            return false;
        });


        if(!readOnly){
            /**
             * 选择施工单位
             */
            $('.layui-form').on('click', '#sgCorpName', function () {
                var $this = $(this);
                selectOrg(9,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#sgComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择设计单位
             */
            $('.layui-form').on('click', '#sjCorpName', function () {
                var $this = $(this);
                selectOrg(3,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#sjComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择监理单位
             */
            $('.layui-form').on('click', '#jlCorpName', function () {
                var $this = $(this);
                selectOrg(11,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#jlComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择审图单位
             */
            $('.layui-form').on('click', '#stCorpName', function () {
                var $this = $(this);
                selectOrg(4,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#stComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择勘察单位
             */
            $('.layui-form').on('click', '#kcCorpName', function () {
                var $this = $(this);
                selectOrg(2,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#stComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择检测单位
             */
            $('.layui-form').on('click', '#jcCorpName', function () {
                var $this = $(this);
                selectOrg(12,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#jcComartiperson').val(res[0].comartiperson);
                });
            });

            /**
             * 选择预拌混凝土单位
             */
            $('.layui-form').on('click', '#ybhntCorpName', function () {
                var $this = $(this);
                selectOrg(13,function(res){
                    $this.val(res[0].orgName);
                    $this.next().val(res[0].orgNo);
                    $('#ybhntComartiperson').val(res[0].comartiperson);
                });
            });

        }

        /**
         * 选择不同类型的机构
         * @param orgType
         * @param callback
         */
        function selectOrg(orgType,callback){
            top.layer.open({
                type: 2,
                title:"选择单位",
                area: configureCom.Psize1,
                content: configureCom.nocache(''+configure.ORG_SELECT_HTML+'?orgType='+orgType),
                btn: ['选择'],
                yes: function (index, layero) {
                    var iframeWin = top.window.frames['layui-layer-iframe' + index]; //得到iframe页的窗口对
                    callback(iframeWin.getData())
                    top.layer.close(index);
                }
            });



        }








    });

    function getData() {
        return new Promise(function (res, rej) {
            var data = {};
            if (!window.formVerifyFun()) {
                //return false;
            }

            $('.formData').each(function (index, item) {
                var key = $(item).attr('name');
                var type = $(item).attr('type');
                if(type=='radio'){
                    data[key] = $("input[name='"+key+"']:checked").val();
                }else{
                    data[key] = $(item).val();
                }
            });
            console.log(data);
            res({result: data});
        });
    }

</script>
</body>
</html>
